package club.justwill.single.Service.impl;

import club.justwill.single.Tools;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import java.util.Random;

public abstract class BaseService {
	@Autowired
	@Qualifier("tools")
	private ObjectFactory<Tools> toolsFactory;

	protected Tools getTools() {
		return toolsFactory.getObject();
	}

	protected String generateSecurityCode() {
		Random r = new Random();
		return Integer.toString(r.nextInt(1000000));
	}
}